// WARNING: This file has been generated. Any manual changes must be made within preserved regions or they will be lost.

//===============================================================================
//
// AgileFileInfoTests
//
// PURPOSE: 
// Tests the functionality of AgileFileInfo.
//
// NOTES: 
// 
//
//===============================================================================
//
// Copyright (C) 2003 Wallis Software Solutions
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
// FITNESS FOR A PARTICULAR PURPOSE.
//
//===============================================================================

using System.IO;
using NUnit.Framework;

namespace Agile.Common.Tests
{
    /// <summary>
    /// Tests the functionality of AgileFileInfo.
    /// </summary>
    [TestFixture]
    public class AgileFileInfoTests
    {
        /// <summary>
        /// Verifies we can get the name and name excluding the extension from an AgileFileInfo
        ///     - Create an AgileFileInfo for the BuildLog.txt
        ///     - Check name is BuildLog.txt
        ///     - Check NameExcludingExtension is BuildLog
        ///     
        ///     - Create an AgileFileInfo for the master.build
        ///     - Check name is master.build
        ///     - Check NameExcludingExtension is master
        /// </summary>
        [Test]
        public void NameTests()
        {
            // Create an AgileFileInfo for the BuildLog.txt
            AgileFileInfo file = AgileFileInfo.Build(new FileInfo(@"C:\Dev\BuildLog.txt"));
            // Check name is BuildLog.txt
            Assert.AreEqual("BuildLog.txt", file.Name, "BuildLog.txt");
            // Check NameExcludingExtension is BuildLog
            Assert.AreEqual("BuildLog", file.NameExcludingExtension, "BuildLog");
            //
            // Create an AgileFileInfo for the master.build
            file = AgileFileInfo.Build(new FileInfo(@"C:\Dev\master.build"));
            // Check name is master.build
            Assert.AreEqual("master.build", file.Name, "master.build");
            // Check NameExcludingExtension is master
            Assert.AreEqual("master", file.NameExcludingExtension, "master");
        }
    }
}